import 'package:flutter/material.dart';

AppBar myAppBar(BuildContext context,
    {String leftText = '  总资产',backgroundColor, List<Widget> action}) {
  return AppBar(
    elevation: 0,
    backgroundColor:backgroundColor ,
    titleSpacing: 0.0,
    title: Container(
      padding: EdgeInsets.only(left: 16),
      alignment: Alignment.centerLeft,
      child: GestureDetector(
        child: Row(
          children: <Widget>[
            GestureDetector(
              child: Icon(
                IconData(0xe624, fontFamily: 'iconFont'),
                size: 18,
              ),
              onTap: () {
                Navigator.pop(context);
              },
            ),
            Text(leftText)
          ],
        ),
        onTap: () {},
      ),
    ),
    automaticallyImplyLeading: false,
    actions:action?? <Widget>[
      Center(
        child: GestureDetector(
          child: Container(
            child: Text(
              '服务',
              style: TextStyle(fontSize: 16),
            ),
            padding: EdgeInsets.only(right: 16),
          ),
          onTap: () {},
        ),
      )
    ],
  );
}
